<template>
    <div class="studentPersonInfo">
      <avatarUpload></avatarUpload>
      <el-form ref="form" :model="form" label-width="80px" class="content">
        <el-form-item label="学号">
          <el-input v-model="form.studentId"></el-input>
        </el-form-item>
        <el-form-item label="姓名">
          <el-input v-model="form.studentName"></el-input>
        </el-form-item>
        <el-form-item label="性别">
          <el-radio-group v-model="form.studentSex">
            <el-radio label="男"></el-radio>
            <el-radio label="女"></el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="出生年月">
          <el-col>
            <el-date-picker type="date" placeholder="选择日期" v-model="form.studentBirth" style="width: 100%;"></el-date-picker>
          </el-col>
        </el-form-item>
        <el-form-item label="班级">
          <el-input v-model="form.classId"></el-input>
        </el-form-item>
        <el-form-item label="职务">
          <el-input v-model="form.studentJob"></el-input>
        </el-form-item>
        <el-form-item label="银行卡号">
          <el-input v-model="form.bankCard"></el-input>
        </el-form-item>
        <el-form-item label="身份证号">
          <el-input v-model="form.IdNum"></el-input>
        </el-form-item>
        <el-form-item label="头像">
          <el-input v-model="form.studentPhoto"></el-input>
        </el-form-item>
        <el-form-item label="联系方式">
          <el-input v-model="form.phone"></el-input>
        </el-form-item>
        <el-form-item label="邮箱">
          <el-input v-model="form.studentEmail"></el-input>
        </el-form-item>


        <el-form-item>
          <el-button type="primary" @click="onSubmit">保存</el-button>
          <el-button>取消</el-button>
        </el-form-item>
      </el-form>
    </div>
</template>
<style>
  .content{
    width: 960px;
    margin: 20px auto 10px;
  }
</style>
<script>
    import AvatarUpload from '../fileUpload/avatarUpload'
    export default{
        name : 'studentPersonInfo',
        data(){
            return{
                form: {
                  studentId:'',
                  studentName: '',
                  studentSex: '',
                  studentBirth: '',
                  classId: '',
                  studentJob:'',
                  bankCard:'',
                  IdNum:'',
                  studentPhoto:'',
                  phone:'',
                  studentEmail:''
                }
            }
        },
        components:{
            AvatarUpload
        },
        methods: {
            onSubmit() {
                this.$http.post('http://localhost:8080/TeachingMIS/studentBaseInfo/addStudent',this.form).then(response => {
                    console.log('成功');
                }, response => {
                   console.log('文件获取失败');
                });
            }
        }
    }
</script>
